#include"ThreadPool.hpp"
#include"Task.hpp"


int main()
{
    ThreadPool<Task> *tp = new ThreadPool<Task>(5);
    tp->Start();
    srand(time(nullptr));
    while(true)
    {
        //构建任务
        int x = rand() % 10 + 1;
        usleep(10);
        int y = rand() % 10 + 1;
        char op = opers[rand()%opers.length()];

        Task t(x, y, op);
        tp->Push(t);
        //交给线程池处理
        cout<<"main thread make task:"<<t.GetTask()<<endl;
        sleep(1);
    }
    return 0;
}